<template>
  <div id="name">
    <div class="wl-body">
      <div class="xx-bods">
        <div class="xx-title t-left">
          {{ dqyy == "en-US" ? data.titleEn : data.title }}
        </div>
        <div class="xx-time t-left">{{ data.createTime }}</div>

        <div
          class="xx-content"
          v-if="dqyy == 'zh-CN'"
          v-html="data.content"
          @click="getpreview($event)"
        ></div>
        <div
          class="xx-content"
          v-if="dqyy == 'en-US'"
          v-html="data.contentEn"
          @click="getpreview($event)"
        ></div>
      </div>
    </div>
  </div>
</template>

<script>
import { ImagePreview } from "vant";
export default {
  name: "name",
  data() {
    return {
      isPublish: false,
      data: "",
      dqyy: this.$store.getters.language || "zh-CN",
    };
  },

  created() {
    this.data = JSON.parse(sessionStorage.getItem("hpdata"));
    if (this.data == null) {
      this.$router.push({ path: "/" });
    }
  },
  methods: {
    getpreview(e) {
      if (e.target.tagName == "IMG") {
        ImagePreview({
          images: [e.target.src],
          closeOnPopstate: true, //页面回退关闭预览
        });
      }
    },
    guanbi() {
      this.$router.go(-1);
    },
    //        preview(src, e) {

    // },
    // navigate(href, e) {
    //   // do something
    // }
  },
};
</script>

<style lang="scss" scoped></style>
